import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');

@Define.Table({ TableName: "terminal" })
export class Terminal extends EntityObjectType<Terminal>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        DataLength: 1000
    })
    os: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    mac: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    type: TerminalType;

    @Define.Column({
        DataType: Define.DataType.JSON,
    })
    setting: TerminalSetting;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    storeId: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;
}

export enum TerminalType {
    POS = 'pos',
    Produce = 'produce',
    Office = 'office',
    FoodDelivery = 'foodDelivery'
}

export interface TerminalSetting {
    
}
